class Storage {
  constructor(storageObject) {
    this.storageObject = storageObject
  }

  get(key, defaultValue) {
    return window[this.storageObject].get(key) || defaultValue
  }

  set(key, value) {
    window[this.storageObject].set(key, value)
  }

  clear() {
    window[this.storageObject].clear()
  }
}

export default new Storage('localStorage')
